import { bindingStation } from '@/api/product/station-manage';
const stationOperation = {
    namespaced: true,
    state: {
        workStationInfo: {},
        workOrderId: ''
    },
    actions: {
        getBindingStationInfo({ commmit }, params) {
            return new Promise((resolve, reject) => {
                bindingStation(params).then((res) => {
                    resolve(res);
                }).catch((error) => {
                    reject(error);
                });
            });
        }
    },
    mutations: {
        // 设置工站操作页所需参数
        setworkStationInfo: (state, data) => {
            state.workStationInfo = data;
            localStorage.setItem('workStationInfo', JSON.stringify(data));
        },
        //设置工单ID
        setWorkOrderId: (state, data) => {
            state.workOrderId = data;
        }
    }
};
export default stationOperation;